﻿using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;
namespace CRM.Models
{
    [Table("BuyerData")]
    [Comment("买家数据")]
    public class BuyerData : BaseModel
    {
        [Column("id"), Key]
        public int Id { get; set; }

        [Column("dataId"), Comment("拉取的买家数据id")]
        public int DataId { get; set; }

        [Column("type"), Comment("类型"), Required]
        public Types Type { get; set; }
        public enum Types{
            [Description("全球采购商")]
            Foreign = 1,
            [Description("国内采购商")]
            Internal = 2
        }
       
        [Column("productCode"), Comment("产品码")]
        public string ProductCode { get; set; }
      
        [Column("buyerCompanyId"), Comment("爬取的公司ID")]
        #nullable enable
        public string? BuyerCompanyId { get; set; }
        #nullable restore
     
        [Column("title"), Comment("标题"), Required]
        public string Title { get; set; }
        
        [Column("image"), Comment("图片")]
        public string Image { get; set; }
        
        [Column("details"), Comment("详情"), Required]
        public string Details { get; set; }
        
        [Column("releaseTime"), Comment("发布时间"), Required]
        public string ReleaseTime { get; set; }
        
        [Column("expireTime"), Comment("到期时间")]
        public string ExpireTime { get; set; }
        
        [Column("country"), Comment("国家")]
        public string Country { get; set; }
        
        [Column("countryFlag"), Comment("国旗")]
        public string CountryFlag { get; set; }

        [Column("destination"), Comment("目的地")]
        public string Destination { get; set; }

        [Column("follow"), Comment("follow")]
        public string Follow { get; set; }

        [Column("paymentTerms"), Comment("付款方式")]
        public string PaymentTerms { get; set; }
        
        [Column("urlLink"), Comment("链接")]
        public string UrlLink { get; set; }
        
        [Column("address"), Comment("地址")]
        public string Address { get; set; }
        
        [Column("requireQuantity"), Comment("需求量"), Required]
        public string RequireQuantity { get; set; }

        [Column("requireAmount"), Comment("需求金额")]
        public string RequireAmount { get; set; }

        [Column("shippingTerms"), Comment("发运方式")]
        public string ShippingTerms { get; set; }
        
        [Column("supplierArea"), Comment("供应商区域")]
        public string SupplierArea { get; set; }
        
        [Column("targetPrice"), Comment("目标价格")]
        public string TargetPrice { get; set; }
        
        [Column("contacts"), Comment("联系人")]
        public string Contacts { get; set; }
        
        [Column("mailbox"), Comment("邮箱")]
        public string Mailbox { get; set; }
        
        [Column("wechat"), Comment("微信"),]
        public string Wechat { get; set; }
        
        [Column("phone"), Comment("电话")]
        public string Phone { get; set; }
        
        [Column("categoryStubs"), Comment("分类群")]
        public string CategoryStubs { get; set; }

        [Column("state"), Comment("状态(0:未发布,1:已发布,2:发布撤回,3:删除)"),Required]
        public States State { get; set; }
        public enum States
        {
            [Description("未发布")]
            Unpublish = 0,
            [Description("已发布")]
            Published = 1,
            [Description("发布撤回")]
            Revoked = 2,
            [Description("删除")]
            Deleted = 3
        }
        [Column("remark"), Comment("备注")]
        public string? Remark { get; set; }
        public int OemId { get; set; }
        public int CompanyId { get; set; }
        public int GroupId { get; set; }
        public int UserId { get; set; }
    }
}
